<DModal
  @closeModal={{@closeModal}}
  @title={{i18n "user_notes.title"}}
  class="user-notes-modal"
>
  <Textarea @value={{this.newNote}} />
  <DButton
    @action={{this.attachNote}}
    @label="user_notes.attach"
    @disabled={{this.attachDisabled}}
    class="btn-primary"
  />

  {{#each @model.note as |n|}}
    <div class="user-note">
      <div class="posted-by">
        <UserLink @user={{n.created_by}}>
          {{avatar n.created_by imageSize="small"}}
        </UserLink>
      </div>
      <div class="note-contents">
        <div class="note-info">
          <span class="username">{{n.created_by.username}}</span>
          <span class="post-date">{{age-with-tooltip n.created_at}}</span>

          {{#if n.can_delete}}
            <span class="controls">
              <DButton
                @action={{fn this.removeNote n}}
                @icon="far-trash-can"
                @title="user_notes.remove"
                class="btn-small btn-danger"
              />
            </span>
          {{/if}}
        </div>

        <div class="cooked">
          <CookText @rawText={{n.raw}} />
        </div>

        {{#if n.post_id}}
          <a href={{n.post_url}} class="btn btn-small">
            {{i18n "user_notes.show_post"}}
          </a>
        {{/if}}
      </div>

      <div class="clearfix"></div>
    </div>
  {{/each}}
</DModal>